﻿namespace PageTypeBuilderUI.Configuration
{
    using System.Configuration;

    public class PageTypeBuilderUIConfiguration : ConfigurationSection
    {
        public static PageTypeBuilderUIConfiguration GetConfiguration()
        {
            PageTypeBuilderUIConfiguration configuration = ConfigurationManager.GetSection("pageTypeBuilderUI") as PageTypeBuilderUIConfiguration;

            if (configuration != null)
                return configuration;

            return new PageTypeBuilderUIConfiguration();
        }

        [ConfigurationProperty("enablePageTypeUpdating", IsRequired = false, DefaultValue = false)]
        public virtual bool EnablePageTypeUpdating
        {
            get
            {
                return (bool)this["enablePageTypeUpdating"];
            }
        }


        [ConfigurationProperty("enableCustomPropertyGroupRendering", IsRequired = false, DefaultValue = false)]
        public virtual bool EnableCustomPropertyGroupRendering
        {
            get
            {
                return (bool)this["enableCustomPropertyGroupRendering"];
            }
        }

        [ConfigurationProperty("customRenderingControlType", IsRequired = false, DefaultValue = "PageTypeBuilderUI.CustomProperties.PropertyGroupPropertyControl,PageTypeBuilderUI")]
        public virtual string CustomRenderingControlType
        {
            get
            {
                return (string)this["customRenderingControlType"];
            }
        }

        [ConfigurationProperty("xmlns", IsRequired = false)]
        public string XmlNamespace
        {
            get
            {
                return "http://PageTypeBuilderUI.Configuration.PageTypeBuilderUIConfiguration";
            }
        }
    }
}
